var express = require('express');
var router = express.Router();
const reactAdmin = [
    {
        id: 0,
        pid: "",
        path: "/home",
        element: "/home/index",
        type: "menu",
        meta: {
            key: "home",
            title: "首页",
            icon: "HomeOutlined",
            isLink: "",
            isKeepAlive: false,
            isHide: false,
            isAffix: true,
            isFull: false
        }
    },
    // {
    //   id: 1,
    //   pid: "",
    //   path: "/testMange",
    //   redirect: "/testMange/test1/test1-1",
    //   type: "dir",
    //   meta: { title: "testMange", icon: "Bookmark", key: "testMange", isLink: "", isHide: false },
    //   children: [
    //     {
    //       id: 1,
    //       pid: 1,
    //       path: "/testMange/test1",
    //       redirect: "/testMange/test1/test1-1",
    //       type: "dir",
    //       meta: {
    //         key: "test1",
    //         title: "test1",
    //         icon: "Rss",
    //         isLink: "",
    //         isKeepAlive: false,
    //         isHide: false
    //       },
    //       children: [
    //         {
    //           id: 1,
    //           pid: 1,
    //           path: "/testMange/test1/test1-1",
    //           element: "/testMange/test1/test1-1/index",
    //           type: "menu",
    //           meta: {
    //             key: "test1-1",
    //             title: "test1-1",
    //             icon: "AppstoreOutlined",
    //             isLink: "",
    //             isKeepAlive: false,
    //             isHide: false,
    //             activeMenu: "/testMange/test1/test1-1"
    //           }
    //         }
    //       ]
    //     },
    //     {
    //       id: 2,
    //       pid: 1,
    //       path: "/testMange/test2",
    //       element: "/testMange/test2/index",
    //       type: "menu",
    //       meta: {
    //         key: "test2",
    //         title: "test2",
    //         icon: "Coupon",
    //         isLink: "",
    //         isKeepAlive: false,
    //         isHide: false
    //       },
    //       children: [
    //         {
    //           id: 1,
    //           pid: 2,
    //           path: "/testMange/test2/test2-1",
    //           element: "/testMange/test2/test2-1/index",
    //           type: "menu",
    //           meta: {
    //             key: "test2-1",
    //             title: "test2-1",
    //             icon: "AppstoreOutlined",
    //             isLink: "",
    //             isKeepAlive: false,
    //             isHide: true,
    //             activeMenu: "/testMange/test2"
    //           }
    //         }
    //       ]
    //     },
    //     {
    //       id: 3,
    //       pid: 1,
    //       path: "/testMange/auth",
    //       element: "/testMange/auth/index",
    //       type: "menu",
    //       meta: {
    //         key: "auth",
    //         title: "按钮权限",
    //         icon: "Currency",
    //         isLink: "",
    //         isKeepAlive: false,
    //         isHide: false
    //       }
    //     }
    //   ]
    // },
    {
        id: 3,
        pid: "",
        path: "/system",
        redirect: "/system/user",
        type: "dir",
        meta: { title: "系统管理", icon: "SettingOutlined", key: "system", isAffix: false, isFull: false, isHide: false, isLink: "" },
        children: [
            {
                id: 1,
                pid: 3,
                path: "/system/user",
                element: "/system/user/index",
                type: "menu",
                meta: {
                    key: "user",
                    title: "用户管理",
                    icon: "UserOutlined",
                    isLink: "",
                    isKeepAlive: false,
                    isHide: false,
                    isAffix: false,
                    isFull: false
                }
            },
            {
                id: 2,
                pid: 3,
                path: "/system/role",
                element: "/system/role/index",
                type: "menu",
                meta: {
                    key: "role",
                    title: "角色管理",
                    icon: "TeamOutlined",
                    isLink: "",
                    isKeepAlive: false,
                    isHide: false,
                    isAffix: false,
                    isFull: false
                }
            },
            {
                id: 3,
                pid: 3,
                path: "/system/menu",
                element: "/system/menu/index",
                type: "menu",
                meta: {
                    key: "menu",
                    title: "菜单管理",
                    icon: "MenuOutlined",
                    isLink: "",
                    isKeepAlive: false,
                    isHide: false,
                    isAffix: false,
                    isFull: false
                }
            },
            {
                id: 4,
                pid: 3,
                path: "/system/permission",
                element: "/system/permission/index",
                type: "menu",
                meta: {
                    key: "permission",
                    title: "权限管理",
                    icon: "SolutionOutlined",
                    isLink: "",
                    isKeepAlive: false,
                    isHide: false,
                    isAffix: false,
                    isFull: false
                }
            }
        ]
    }
]
const admin = [
    {
        id: 0,
        pid: '',
        path: '/home',
        element: '/home/index',
        type: 'menu',
        meta: {
            key: 'home',
            title: '首页',
            icon: 'HomeOutlined',
            isLink: "",
            isKeepAlive: false,
            hidden: false
        },
    }, {
        id: 1,
        pid: '',
        path: '/testMange',
        redirect: '/testMange/test1/test1-1',
        type: 'dir',
        meta: {title: 'testMange', icon: 'Bookmark', key: 'testMange', isLink: "", hidden: false},
        children: [
            {
                id: 1,
                pid: 1,
                path: '/testMange/test1',
                redirect: '/testMange/test1/test1-1',
                type: 'dir',
                meta: {
                    key: 'test1',
                    title: 'test1',
                    icon: 'Rss',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                },
                children: [
                    {
                        id: 1,
                        pid: 1,
                        path: '/testMange/test1/test1-1',
                        element: '/testMange/test1/test1-1/index',
                        type: 'menu',
                        meta: {
                            key: 'test1-1',
                            title: 'test1-1',
                            icon: 'AppstoreOutlined',
                            isLink: "",
                            isKeepAlive: false,
                            hidden: false,
                            activeMenu: '/testMange/test1/test1-1'
                        }
                    },
                ]
            },
            {
                id: 2,
                pid: 1,
                path: '/testMange/test2',
                element: '/testMange/test2/index',
                type: 'menu',
                meta: {
                    key: 'test2',
                    title: 'test2',
                    icon: 'Coupon',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                },
                children: [
                    {
                        id: 1,
                        pid: 2,
                        path: '/testMange/test2/test2-1',
                        element: '/testMange/test2/test2-1/index',
                        type: 'menu',
                        meta: {
                            key: 'test2-1',
                            title: 'test2-1',
                            icon: 'AppstoreOutlined',
                            isLink: "",
                            isKeepAlive: false,
                            hidden: true,
                            activeMenu: '/testMange/test2'
                        }
                    },
                ]
            },
            {
                id: 3,
                pid: 1,
                path: '/testMange/auth',
                element: '/testMange/auth/index',
                type: 'menu',
                meta: {
                    key: 'auth',
                    title: '按钮权限',
                    icon: 'Currency',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                },
            },
        ]
    }, {
        id: 3,
        pid: '',
        path: '/system',
        redirect: '/system/user',
        type: 'dir',
        meta: {title: '系统管理', icon: 'SettingOutlined', key: 'system', isLink: "", hidden: false},
        children: [
            {
                id: 1,
                pid: 3,
                path: '/system/user',
                element: '/system/user/index',
                type: 'menu',
                meta: {
                    key: 'user',
                    title: '用户管理',
                    icon: 'UserOutlined',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                }
            },
            {
                id: 2,
                pid: 3,
                path: '/system/role',
                element: '/system/role/index',
                type: 'menu',
                meta: {
                    key: 'role',
                    title: '角色管理',
                    icon: 'TeamOutlined',
                    isLink: "",
                    isKeepAlive: true,
                    hidden: false
                }
            },
            {
                id: 3,
                pid: 3,
                path: '/system/menu',
                element: '/system/menu/index',
                type: 'menu',
                meta: {
                    key: 'menu',
                    title: '菜单管理',
                    icon: 'MenuOutlined',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                }
            },
            {
                id: 4,
                pid: 3,
                path: '/system/permission',
                element: '/system/permission/index',
                type: 'menu',
                meta: {
                    key: 'permission',
                    title: '权限管理',
                    icon: 'SolutionOutlined',
                    isLink: "",
                    isKeepAlive: false,
                    hidden: false
                }
            }
        ]
    }]
/* GET home page. */
router.post('/', function (req, res, next) {
    res.send({
        code: 200,
        message: 'success',
        data: reactAdmin
    })

});

module.exports = router;
